/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package demo928;

import java.util.ArrayList;

/**
 *
 * @author Administrator
 */
public class StudentArrayListDemo {
   
  
    public static void main(String args[]){
       
       
        ArrayList<Student> studentList=new ArrayList<Student>();
       Student studentA=new Student("123", "li", 90);
         Student studentB=new Student("124", "wang", 91);
        Student studentC=new Student("125", "zhao", 92);
        
        studentList.add(studentA);
        studentList.add(studentB);
        studentList.add(studentC);
        
        for(int i=0;i<studentList.size();i++){
         Student st=studentList.get(i);
          System.out.println(st.getInfo());
            
         // System.out.println(studentList.get(i).getInfo());
            
        }
        
        for(Student s:studentList){
          System.out.println(s);
            
        }
        
     
        
        
        
        
        
        
    }
    
}
